﻿using System.IO;
using System.Windows.Controls;

namespace AdTech.Snap
{
    /// <summary>
    /// </summary>
    public interface IQRCodeFactory
    {
        /// <summary>
        /// Generates a QRCode of the given object.
        /// </summary>
        /// <param name="obj">A <see cref="AdTech.Snap.QRCode"/> object that holds the information for a QRCode request.</param>
        /// <returns>The byte array of the generated QRCode.</returns>
        byte[] Encode(QRCode obj);
        /// <summary>
        /// Generates a QRCode of the given content and returns it as a WPF Canvas.
        /// </summary>
        /// <param name="content">The content to encode.</param>
        /// <returns>A WPF Canvas object that represents the QRCode.</returns>
        Canvas EncodeAsXaml(string content);
        /// <summary>
        /// Decodes a QRCode from an image using the given filepath.
        /// </summary>
        /// <param name="fromImage">The file path of the QRCode image.</param>
        /// <returns>An <see cref="AdTech.Snap.QRCode"/> object that contains information about the given QRCode.</returns>
        QRCode Decode(string fromImage);
        /// <summary>
        /// Decodes a QRCode from an image stream.
        /// </summary>
        /// <param name="fromImage">A stream of the QRCode image.</param>
        /// <returns>An <see cref="AdTech.Snap.QRCode"/> object that contains information about the given QRCode.</returns>
        QRCode Decode(Stream fromImage);
    }
}
